Skip to content

Improve error-page recovery navigation to prevent dead ends#1103

Merged
BenjaminMichaelis merged 3 commits into
mainfrom
copilot/fix-sidebar-on-error
May 14, 2026
Merged

Improve error-page recovery navigation to prevent dead ends#1103
BenjaminMichaelis merged 3 commits into
mainfrom
copilot/fix-sidebar-on-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 14, 2026

Users hitting invalid URLs could end up on the error page with limited recovery options, making it easy to get stuck unless they manually edited the URL. This update adds a direct path back into book content and locks the behavior with functional coverage.

  • Error page UX

    • Added a Browse Chapters action to Views/Home/Error.cshtml.
    • The new action links directly to /hello-world (first chapter entry point), alongside existing Go Home and Go Back actions.
  • Functional regression coverage

    • Extended WhenTheApplicationStarts_NonExistingPage_GivesCorrectStatusCode in EssentialCSharp.Web.Tests/FunctionalTests.cs to assert all three recovery actions are present in the rendered error response.
<div class="d-flex gap-2">
    <a href="/home" class="btn btn-primary">Go Home</a>
    <a href="/hello-world" class="btn btn-outline-primary">Browse Chapters</a>
    <button type="button" class="btn btn-secondary"
            onclick="if(history.length > 1){ history.back(); } else { window.location='/home'; }">
        Go Back
    </button>
</div>

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.hcaptcha.com
    • Triggering command: /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests --server dotnettestcli --dotnet-test-pipe /tmp/ea305378337b41c2abd59e9e4dc23d5a (dns block)
    • Triggering command: /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests --server dotnettestcli --dotnet-test-pipe /tmp/84e60f0dcfee4db0ba5c3e0cdabee6fc /var/lib/dpkg/info/php-pear.list /var/lib/dpkg/info/libip4tc2:amd64.list /var/lib/dpkg/info/libnpth0t64:amd64.list /var/lib/dpkg/info/libgcc-12-dev:amd64.list /var/lib/dpkg/info/libxext6:amd64.list /var/lib/dpkg/info/libclang-rt-18-dev:amd64.list /var/lib/dpkg/info/libpopt0:amd64.list (dns block)
  • api.pwnedpasswords.com
    • Triggering command: /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests --server dotnettestcli --dotnet-test-pipe /tmp/ea305378337b41c2abd59e9e4dc23d5a (dns block)
    • Triggering command: /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests /home/REDACTED/work/EssentialCSharp.Web/EssentialCSharp.Web/EssentialCSharp.Web.Tests/bin/Release/net10.0/EssentialCSharp.Web.Tests --server dotnettestcli --dotnet-test-pipe /tmp/84e60f0dcfee4db0ba5c3e0cdabee6fc /var/lib/dpkg/info/php-pear.list /var/lib/dpkg/info/libip4tc2:amd64.list /var/lib/dpkg/info/libnpth0t64:amd64.list /var/lib/dpkg/info/libgcc-12-dev:amd64.list /var/lib/dpkg/info/libxext6:amd64.list /var/lib/dpkg/info/libclang-rt-18-dev:amd64.list /var/lib/dpkg/info/libpopt0:amd64.list (dns block)
  • cdn.jsdelivr.net
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-edgeupdater --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits May 14, 2026 06:43
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/6b13d96a-7257-4f57-984d-9d59b791e7f7

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/IntelliTect/EssentialCSharp.Web/sessions/6b13d96a-7257-4f57-984d-9d59b791e7f7

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix sidebar navigation upon error Improve error-page recovery navigation to prevent dead ends May 14, 2026
Copilot AI requested a review from BenjaminMichaelis May 14, 2026 06:45
@BenjaminMichaelis BenjaminMichaelis marked this pull request as ready for review May 14, 2026 13:15
Copilot AI review requested due to automatic review settings May 14, 2026 13:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the 404/error-page recovery experience by adding an explicit navigation path back into the book content, and extends functional coverage to prevent regressions (aligns with the “stuck on error page” user report in repo issue #104).

Changes:

  • Added a Browse Chapters action on the error page linking to /hello-world as a first content entry point.
  • Extended the existing functional test for non-existing pages to assert that all three recovery actions are rendered.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
EssentialCSharp.Web/Views/Home/Error.cshtml Adds a “Browse Chapters” button next to existing “Go Home” and “Go Back” recovery actions.
EssentialCSharp.Web.Tests/FunctionalTests.cs Updates the 404 functional test to assert the presence of the three recovery actions in the error response HTML.

@BenjaminMichaelis BenjaminMichaelis merged commit 1f57837 into main May 14, 2026
12 checks passed
@BenjaminMichaelis BenjaminMichaelis deleted the copilot/fix-sidebar-on-error branch May 14, 2026 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide useful "go back" or fix sidebar upon error

3 participants